package tech.yunland.shop.domain.service;

import com.moyuer.bsf.domain.dao.BaseDao;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author 李珂
 * @email likenamehaojie@hotmail.com
 */
@Service
public class WeiXinServices extends BaseDao<String,String> {


    public String getByOpenId(String openId) {

        String sql = "select wx.organ_id as organ_id from wx_user_organ wx where wx.openid = ?";
        Map<String,Object> result = this.findUniqueBySQL(sql,new Object[]{openId});
        if(result!=null&&result.containsKey("organ_id")){
                return (String)result.get("organ_id");
        }
        return null;

    }
}
